package cn.itcast.bassm.pojo;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class test01 {
	   public static void main(String[] args) {

	        String s1 = "20151117190936";
	        try {
	            Date date1 = new SimpleDateFormat("yyyyMMddHHmmss").parse(s1);
	            //输出格式
	            System.out.println("=======解析字符串1======");
	            System.out.println(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(date1));
	            System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date1));
	          String ming = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date1);
	          System.out.println(ming);
	        } catch (ParseException e) {
	            e.printStackTrace();
	        }
	    }

	}

